import request from '@/config/axios'

// 项目需求属性表单 VO
export interface RequireAttributesVO {
  id: number // 自增主键
  requirementId: string // 关联需求编号
  priority: string // 需求优先级
  weight: number // 需求权重（衡量重要程度）
  requirementStatus: string // 需求状态
  estimatedCompletionDate: Date // 预计需求完成日期
  actualCompletionDate: Date // 实际需求完成日期
}

// 项目需求属性表单 API
export const RequireAttributesApi = {
  // 查询项目需求属性表单分页
  getRequireAttributesPage: async (params: any) => {
    return await request.get({ url: `/project/require-attributes/page`, params })
  },

  // 查询项目需求属性表单详情
  getRequireAttributes: async (id: number) => {
    return await request.get({ url: `/project/require-attributes/get?id=` + id })
  },

  // 新增项目需求属性表单
  createRequireAttributes: async (data: RequireAttributesVO) => {
    return await request.post({ url: `/project/require-attributes/create`, data })
  },

  // 修改项目需求属性表单
  updateRequireAttributes: async (data: RequireAttributesVO) => {
    return await request.put({ url: `/project/require-attributes/update`, data })
  },

  // 删除项目需求属性表单
  deleteRequireAttributes: async (id: number) => {
    return await request.delete({ url: `/project/require-attributes/delete?id=` + id })
  },

  // 导出项目需求属性表单 Excel
  exportRequireAttributes: async (params) => {
    return await request.download({ url: `/project/require-attributes/export-excel`, params })
  },
}